package net.myspring.canal.canalserver;

import net.myspring.canal.canalserver.service.CanalExample2Service;
import net.myspring.canal.canalserver.service.CanalExampleService;
import net.myspring.canal.canalserver.service.CanalService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication(exclude = {
		DataSourceAutoConfiguration.class,
		PersistenceExceptionTranslationAutoConfiguration.class,
		DataSourceTransactionManagerAutoConfiguration.class})
public class CanalServerApplication {

	public static void main(String[] args) {
		ConfigurableApplicationContext context = SpringApplication.run(CanalServerApplication.class, args);
		CanalExampleService canalExampleService = (CanalExampleService) context.getBean("canalExampleService");
		CanalExample2Service canalExample2Service = (CanalExample2Service) context.getBean("canalExample2Service");

		new Thread(canalExampleService,"example").start();
		new Thread(canalExample2Service,"example2").start();
	}
}
